<!DOCTYPE html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8"/>
    <title>厅干部平时考核管理系统</title>
    <link rel="stylesheet" type="text/css" href="<c:url value='/resource/jxkh/css/main.css'/>"/>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/jquery-1.11.0.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/echarts.min.js'/>"></script>
</head>
<body>
<div class="njga" style="overflow: auto;">
    <div class="bmkhcp" id="index_main" style="background: #fff;">
        <div class="bmkhcp_row">
            <div class="bmkhcp_lf" style="width: 100%; height: 100%;">
                <div id="zxt" style="width: 100%;height:680px;"></div>
            </div>
        </div>

    </div>
</div>

<!--折线图结束-->
<script type="text/javascript">
    var myChart = echarts.init(document.getElementById('zxt'));
    myChart.showLoading();
    $.get("<c:url value='/task/relation/khgxview.json'/>", function (data) {
        var obj = data.data;
        console.log(obj);
        myChart.hideLoading();

        echarts.util.each(obj.children, function (datum, index) {
            index % 2 === 0 && (datum.collapsed = true);
        });

        myChart.setOption(option = {
            tooltip: {
                trigger: 'item',
                triggerOn: 'mousemove'
            },
            series: [
                {
                    type: 'tree',

                    data: [obj],

                    top: '1%',
                    left: '7%',
                    bottom: '1%',
                    right: '20%',

                    symbolSize: 7,

                    label: {
                        normal: {
                            position: 'left',
                            verticalAlign: 'middle',
                            align: 'right',
                            fontSize: 13
                        }
                    },

                    leaves: {
                        label: {
                            normal: {
                                position: 'right',
                                verticalAlign: 'middle',
                                align: 'left'
                            }
                        }
                    },

                    expandAndCollapse: true,
                    animationDuration: 550,
                    animationDurationUpdate: 750
                }
            ]
        });
    });
</script>
</body>

</html>